]> dgit.raspbian.org Git - samba.git/commit
use explicit_bzero() instead of memset_explicit()
authorDebian Samba Maintainers <pkg-samba-maint@lists.alioth.debian.org>
Thu, 13 Aug 2026 16:14:56 +0000 (19:14 +0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 13 Aug 2026 16:14:56 +0000 (19:14 +0300)
commit438114f5f25c7cac470003aa5724a7f1da27efda
tree9187193c199bd9f61b55bc7759929352df41b23d
parent79f033130ad238e8b063e51b5f03bbc280f30dc5
use explicit_bzero() instead of memset_explicit()

lib/replace/replace.h header defines ZERO_STRUCT macro
which uses memset_explicit() function (which is similar to
memset() but can not be optimized out by the compiler).
Glibc has explicit_bzero() with similar property, while
memset_explicit() is implemented in lib/replace/replace.c, -
this way, some binaries needlessly link to libreplace
just to get rep_memset_explicit() symbol.  By using
explicit_bzero() instead, this endless linkage is eliminated,
so we can package, for example, libldb (which uses ZERO_STRUCT)
without it linking to libreplace-samba4.

Unfortunately there are just insane amount of similar
but non-standard functions, and upstream don't want
to stay on something simple and robust in this context.

Gbp-Pq: Name use-explicit_bzero-to-zero-memory.diff
lib/replace/replace.h